package com.zbj.hystrix.consumer;

import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * HystrixConfiguration
 * 与application.yml配置文件功能一致
 * @author weigang
 * @create 2019-08-09
 **/
@Configuration
public class HystrixConfiguration {

    //@Bean
    //public ServletRegistrationBean servletRegistrationBean() {
    //    ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(
    //            new HystrixMetricsStreamServlet(), "/hystrix.stream");
    //    servletRegistrationBean.setName("hystrixServlet");
    //    servletRegistrationBean.setLoadOnStartup(1);
    //
    //    return servletRegistrationBean;
    //}
}